package com.wave.spring.boot.controller;

import com.wave.spring.dao.jpa.PersonRepository;
import com.wave.spring.dto.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lv on 2017/8/27.
 */
@RestController
public class JpaController {

    @Autowired
    private PersonRepository personRepository;

    @RequestMapping("/auto")
    public Page<Person> auto(Person person){
        PageRequest page=new PageRequest(1,10);
return  personRepository.finaByAuto(person,page);
    }
}
